package com.millioncool.selfpagingsimple.paging;

import androidx.lifecycle.MutableLiveData;

import java.util.ArrayList;
import java.util.List;

/**
 * 一页数据
 *
 * @Author: QDL
 * @CreateDate: 2021/4/26 15:12
 */
public class PagingPager<T> {
    MutableLiveData<List<T>> pagingLiveData = new MutableLiveData<>();
    LoadState currentState = LoadState.LOADING;
    boolean isRefresh = false;
    PagingSource.RequestNetListener listener;


    public PagingPager(PagingSource.RequestNetListener listener) {
        this.listener = listener;
    }

    public boolean isRefresh() {
        return isRefresh;
    }

    public void setRefresh(boolean refresh) {
        isRefresh = refresh;
    }

    public MutableLiveData<List<T>> getPagingLiveData() {
        return pagingLiveData;
    }

    public void setPagingLiveData(MutableLiveData<List<T>> pagingLiveData) {
        this.pagingLiveData = pagingLiveData;
    }

    public PagingSource.RequestNetListener getListener() {
        return listener;
    }

    public void setListener(PagingSource.RequestNetListener listener) {
        this.listener = listener;
    }

    public LoadState getCurrentState() {
        return currentState;
    }

    public void setCurrentState(LoadState currentState) {
        this.currentState = currentState;
    }
}
